package com.tkmybatis.controller;


import com.tkmybatis.entity.ECTCnUser;
import com.tkmybatis.hfy.base.entity.Result;
import com.tkmybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
@Transactional(rollbackFor = Exception.class)
public class EctCnController {


    @Autowired
    private UserService userService;



    @PostMapping("/insert")
    public Result insertUser(ECTCnUser user){
        return userService.insertUser(user);
    }



    @RequestMapping("/byName")
    public Result selectUserByName(@RequestParam("name") String name){
        return userService.selectbyName(name);
    }


}
